import django_filters

from students.models import Student


class StudentFilter(django_filters.FilterSet):
    start_time = django_filters.DateTimeFilter(field_name='create_time', lookup_expr='gte')
    end_time = django_filters.DateTimeFilter(field_name='create_time', lookup_expr='lte')

    class Meta:
        model = Student
        fields = ['name', 'city', 'create_time']